﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！
using Magicodes.ExporterAndImporter.Core;
using Admin.NET.Core;
namespace Admin.NET.Application;

/// <summary>
/// 审批流程输出参数
/// </summary>
public class StoreProcessFlowStepOutput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public long Id { get; set; }    
    
    /// <summary>
    /// 审批类型
    /// </summary>
    public string FlowType { get; set; }    
    
    /// <summary>
    /// 申请批次
    /// </summary>
    public string? BatchNo { get; set; }    
    
    /// <summary>
    /// 申请号
    /// </summary>
    public string RequestNo { get; set; }    
    
    /// <summary>
    /// 分类Id
    /// </summary>
    public long? StoreTypeId { get; set; }    
    
    /// <summary>
    /// 分类名称
    /// </summary>
    public string? StoreTypeName { get; set; }    
    
    /// <summary>
    /// 分类显示名称（完整路径）
    /// </summary>
    public string? StoreTypeDisplayName { get; set; }    
    
    /// <summary>
    /// 物资Id
    /// </summary>
    public long? MaterialId { get; set; }    
    
    /// <summary>
    /// 物资名称
    /// </summary>
    public string? MaterialName { get; set; }    
    
    /// <summary>
    /// 物资单价
    /// </summary>
    public decimal? MaterialPrice { get; set; }    
    
    /// <summary>
    /// 申请数量
    /// </summary>
    public decimal? Quantity { get; set; }    
    
    /// <summary>
    /// 单位
    /// </summary>
    public string? Unit { get; set; }    
    
    /// <summary>
    /// 物资总价
    /// </summary>
    public decimal? MaterialPriceTotal { get; set; }    
    
    /// <summary>
    /// 申请人ID
    /// </summary>
    public long ApplicantId { get; set; }    
    
    /// <summary>
    /// 申请人姓名
    /// </summary>
    public string? ApplicantName { get; set; }    
    
    /// <summary>
    /// 申请人区域
    /// </summary>
    public string? ApplicantDept { get; set; }    
    
    /// <summary>
    /// 接收人Id
    /// </summary>
    public long? ReceiverId { get; set; }    
    
    /// <summary>
    /// 接收人姓名
    /// </summary>
    public string? ReceiverName { get; set; }    
    
    /// <summary>
    /// 接收人区域
    /// </summary>
    public string? ReceiverDept { get; set; }    
    
    /// <summary>
    /// 申请时间
    /// </summary>
    public DateTime? RequestTime { get; set; }    
    
    /// <summary>
    /// 预期时间
    /// </summary>
    public DateTime? ExpectedDate { get; set; }    
    
    /// <summary>
    /// 完成时间
    /// </summary>
    public DateTime? CompletedTime { get; set; }    
    
    /// <summary>
    /// 新增或更新
    /// </summary>
    public StatusNewOrChangeEnum StatusNewOrChange { get; set; }    
    
    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }    
    
    /// <summary>
    /// 审批状态
    /// </summary>
    public StatusApprovalEnum ApprovalAction { get; set; }    
    
    /// <summary>
    /// 确认负责人ID
    /// </summary>
    public long? ConfirmerId { get; set; }    
    
    /// <summary>
    /// 确认负责人姓名
    /// </summary>
    public string? ConfirmerName { get; set; }    
    
    /// <summary>
    /// 租户Id
    /// </summary>
    public long? TenantId { get; set; }    
    
    /// <summary>
    /// 机构Id
    /// </summary>
    public long? OrgId { get; set; }    
    
    /// <summary>
    /// 软删除
    /// </summary>
    public bool IsDelete { get; set; }    
    
    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime? CreateTime { get; set; }    
    
    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }    
    
    /// <summary>
    /// 创建者Id
    /// </summary>
    public long? CreateUserId { get; set; }    
    
    /// <summary>
    /// 创建者姓名
    /// </summary>
    public string? CreateUserName { get; set; }    
    
    /// <summary>
    /// 修改者Id
    /// </summary>
    public long? UpdateUserId { get; set; }    
    
    /// <summary>
    /// 修改者姓名
    /// </summary>
    public string? UpdateUserName { get; set; }    
    
    /// <summary>
    /// 当前审批步骤
    /// </summary>
    public int CurrentStep { get; set; } = 1;

    /// <summary>
    /// 总审批步骤数
    /// </summary>
    public int TotalSteps { get; set; } = 2;

    /// <summary>
    /// 当前阶段显示名称
    /// </summary>
    public string? CurrentStageName { get; set; }

    /// <summary>
    /// 下一阶段显示名称
    /// </summary>
    public string? NextStageName { get; set; }

    /// <summary>
    /// 下一步审批动作
    /// </summary>
    public StatusApprovalEnum? NextApprovalAction { get; set; }

    /// <summary>
    /// 是否允许当前用户执行同意操作
    /// </summary>
    public bool CanApprove { get; set; }

    /// <summary>
    /// 是否允许当前用户执行拒绝操作
    /// </summary>
    public bool CanReject { get; set; }

    /// <summary>
    /// 是否允许退回上一步
    /// </summary>
    public bool CanReturn { get; set; }

    /// <summary>
    /// 当前阶段是否需要确认人
    /// </summary>
    public bool StageRequiresConfirmer { get; set; }

    /// <summary>
    /// 当前是否处于执行阶段
    /// </summary>
    public bool IsExecutionStage { get; set; }

    /// <summary>
    /// 当前用户是否可以直接跳过审批环节
    /// </summary>
    public bool CanAdminDirectApprove { get; set; }

}

/// <summary>
/// 审批流程导出输出参数
/// </summary>
public class ExportStoreProcessFlowStepOutput : BaseImportInput
{
    /// <summary>
    /// 错误信息（导入时使用，导出时隐藏）
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public override string Error { get; set; }

    /// <summary>
    /// 主键Id
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long Id { get; set; }

    /// <summary>
    /// 审批类型
    /// </summary>
    [ExporterHeader("审批类型", Width = 15, IsBold = true)]
    public string FlowType { get; set; }

    /// <summary>
    /// 申请号
    /// </summary>
    [ExporterHeader("申请号", Width = 20, IsBold = true)]
    public string RequestNo { get; set; }

    /// <summary>
    /// 分类显示名称（完整路径）
    /// </summary>
    [ExporterHeader("分类", Width = 30, IsBold = true)]
    public string? StoreTypeDisplayName { get; set; }

    /// <summary>
    /// 物资名称
    /// </summary>
    [ExporterHeader("物资名称", Width = 25, IsBold = true)]
    public string? MaterialName { get; set; }

    /// <summary>
    /// 申请数量
    /// </summary>
    [ExporterHeader("申请数量", Width = 15, IsBold = true, Format = "0.00")]
    public decimal? Quantity { get; set; }

    /// <summary>
    /// 单位
    /// </summary>
    [ExporterHeader("单位", Width = 15, IsBold = true)]
    public string? Unit { get; set; }

    /// <summary>
    /// 新增或更换
    /// </summary>
    [ExporterHeader("新增/更换", Width = 15, IsBold = true)]
    public StatusNewOrChangeEnum StatusNewOrChange { get; set; }

    /// <summary>
    /// 物资总价
    /// </summary>
    [ExporterHeader("申请价格", Width = 15, IsBold = true, Format = "0.00")]
    public decimal? MaterialPriceTotal { get; set; }

    /// <summary>
    /// 申请人姓名
    /// </summary>
    [ExporterHeader("申请人", Width = 15, IsBold = true)]
    public string? ApplicantName { get; set; }

    /// <summary>
    /// 申请人区域（带完整路径）
    /// </summary>
    [ExporterHeader("申请人区域", Width = 20, IsBold = true)]
    public string? ApplicantDeptPath { get; set; }

    /// <summary>
    /// 接收人姓名
    /// </summary>
    [ExporterHeader("接收人", Width = 15, IsBold = true)]
    public string? ReceiverName { get; set; }

    /// <summary>
    /// 接收人区域（带完整路径）
    /// </summary>
    [ExporterHeader("接收人区域", Width = 20, IsBold = true)]
    public string? ReceiverDeptPath { get; set; }

    /// <summary>
    /// 申请时间
    /// </summary>
    [ExporterHeader("申请时间", Width = 20, IsBold = true, Format = "yyyy-MM-dd")]
    public DateTime? RequestTime { get; set; }

    /// <summary>
    /// 审批状态
    /// </summary>
    [ExporterHeader("审批状态", Width = 15, IsBold = true)]
    public StatusApprovalEnum ApprovalAction { get; set; }

    /// <summary>
    /// 确认负责人姓名
    /// </summary>
    [ExporterHeader("确认负责人", Width = 15, IsBold = true)]
    public string? ConfirmerName { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [ExporterHeader("备注", Width = 30, IsBold = true)]
    public string? Remark { get; set; }

    /// <summary>
    /// 机构ID（用于获取完整路径，不导出）
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? OrgId { get; set; }

    /// <summary>
    /// 接收人ID（用于查询接收人组织，不导出）
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? ReceiverId { get; set; }
}
